package com.ruoyi.modules.screen.service.impl;

import com.ruoyi.modules.screen.service.ScreenService;
import jakarta.annotation.Resource;
import org.springframework.data.redis.core.StringRedisTemplate;
import org.springframework.stereotype.Service;

import java.util.HashMap;
import java.util.Map;

@Service
public class ScreenServiceImpl implements ScreenService {

    @Resource
    private StringRedisTemplate stringRedisTemplate;

    public Map<String,String> getScreenData(){
        String ageData = stringRedisTemplate.opsForValue().get("py_screen:ageData");
        String bookGroupData = stringRedisTemplate.opsForValue().get("py_screen:bookGroupData");
        String creditScoreData = stringRedisTemplate.opsForValue().get("py_screen:creditScoreData");
        String genderData = stringRedisTemplate.opsForValue().get("py_screen:genderData");
        String goodGroupData = stringRedisTemplate.opsForValue().get("py_screen:goodGroupData");
        String hospitalGroupData = stringRedisTemplate.opsForValue().get("py_screen:hospitalGroupData");
        String hotelGroupData = stringRedisTemplate.opsForValue().get("py_screen:hotelGroupData");
        String houseGroupData = stringRedisTemplate.opsForValue().get("py_screen:houseGroupData");
        String jobTypeData = stringRedisTemplate.opsForValue().get("py_screen:jobTypeData");
        String overallGroupData = stringRedisTemplate.opsForValue().get("py_screen:overallGroupData");
        String parkGroupData = stringRedisTemplate.opsForValue().get("py_screen:parkGroupData");
        String regionData = stringRedisTemplate.opsForValue().get("py_screen:regionData");
        String rideGroupData = stringRedisTemplate.opsForValue().get("py_screen:rideGroupData");
        String riskUserTableData = stringRedisTemplate.opsForValue().get("py_screen:riskUserTableData");

        Map<String,String> map = new HashMap<>();
        map.put("ageData",ageData);
        map.put("bookGroupData",bookGroupData);
        map.put("creditScoreData",creditScoreData);
        map.put("genderData",genderData);
        map.put("goodGroupData",goodGroupData);
        map.put("hospitalGroupData",hospitalGroupData);
        map.put("hotelGroupData",hotelGroupData);
        map.put("houseGroupData",houseGroupData);
        map.put("jobTypeData",jobTypeData);
        map.put("overallGroupData",overallGroupData);
        map.put("parkGroupData",parkGroupData);
        map.put("regionData",regionData);
        map.put("rideGroupData",rideGroupData);
        map.put("riskUserTableData",riskUserTableData);

        return map;
    }
}
